package com.cy.pj.module.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

//异常处理三    共性exception处理
@ControllerAdvice
public class doException {
    @ExceptionHandler(ArithmeticException.class)
    @ResponseBody
    public String doHandle(ArithmeticException e){
        e.printStackTrace();
        return "异常为"+e.getMessage();
    }
}
